package pers.whj.rpc.protocol;

import java.util.Arrays;

/**
 * 表示RPC请求的类
 */
public class Request {
    private ServiceDescriptor descriptor;
    private Object[] params;//参数列表
    private long number;

    public ServiceDescriptor getDescriptor() {
        return descriptor;
    }

    public void setDescriptor(ServiceDescriptor descriptor) {
        this.descriptor = descriptor;
    }

    public Object[] getParams() {
        return params;
    }

    public void setParams(Object[] params) {
        this.params = params;
    }

    public long getNumber() {
        return number;
    }

    public void initNumber() {
        number = System.currentTimeMillis();
    }

    @Override
    public String toString() {
        return this.descriptor.toString() + " -> " +
                "parameters: " +
                Arrays.toString(this.params);
    }
}
